#!/bin/bash -e

function info() {
echo Usage: `basename $0` [-c cut_length -m min_len] reads1.fq[.gz] reads2.fq[.gz]
exit 2
}


while getopts  ":e:m:p:" opts
do
        case  $opts  in
		c) cut_length=$OPTARG;;
        m) min_len=$OPTARG;;
		p) out_prefix=$OPTARG;;
		*) info;;
        esac
done
shift $(($OPTIND - 1))

if [ -z "$2" ]; then info; fi
if [ -z "$min_len" ]; then min_len=30; fi
if [ -z "$cut_length" ]; then cut_length=33; fi


. $var

cut_num=+$cut_length

cutadapt \
-m $min_len \
-u $cut_num \
-U $cut_num \
-o $out_prefix.1.cut.fastq \
-p $out_prefix.2.cut.fastq \
$1 \
$2

. $cmd_done
